//
//  XLPersonPageNavBarView.m
//  XiangLove
//
//  Created by 陈宪栋 on 2017/12/18.
//  Copyright © 2017年 BAOMIHUA.COM. All rights reserved.
//

#import "XLPersonPageNavBarView.h"
#import <Masonry.h>

@implementation XLPersonPageNavBarView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView {
    
    _backButton1 = [[UIButton alloc] init];
    _backButton1.alpha = 1;
    [_backButton1 setImage:[[UIImage imageNamed:@"xl_back_white_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
    _backButton1.imageView.tintColor = [UIColor whiteColor];
    [self addSubview:_backButton1];
    [_backButton1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(44, 44));
        make.left.equalTo(self.mas_left).offset(10);
        make.bottom.equalTo(self.mas_bottom);
    }];
    
    _backButton2 = [[UIButton alloc] init];
    _backButton2.alpha = 0;
    [_backButton2 setImage:[[UIImage imageNamed:@"xl_back_white_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
    _backButton2.imageView.tintColor = [UIColor whiteColor];
    [self addSubview:_backButton2];
    [_backButton2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(_backButton1);
    }];
    
    _moreButton1 = [[UIButton alloc] init];
    _moreButton1.alpha = 1;
    [_moreButton1 setImage:[[UIImage imageNamed:@"xl_more_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
    _moreButton1.imageView.tintColor = [UIColor whiteColor];
    [self addSubview:_moreButton1];
    [_moreButton1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(44, 44));
        make.right.equalTo(self.mas_right).offset(-10);
        make.bottom.equalTo(self.mas_bottom);
    }];
    
    _moreButton2 = [[UIButton alloc] init];
    _moreButton2.alpha = 1;
    [_moreButton2 setImage:[[UIImage imageNamed:@"me_icon_fankui_n"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
    _moreButton2.imageView.tintColor = [UIColor whiteColor];
    [self addSubview:_moreButton2];
    [_moreButton2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(_moreButton1);
    }];
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.alpha = 0;
    _titleLabel.font = [UIFont systemFontOfSize:18];
    _titleLabel.textColor = [UIColor whiteColor];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_backButton1.mas_right).offset(5);
        make.right.equalTo(_moreButton1.mas_left).offset(-5);
        make.centerY.equalTo(_backButton1.mas_centerY);
        make.height.mas_equalTo(20);
    }];
}

@end
